package org.example.service.serviceImpl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.example.entity.History;
import org.example.mapper.AttractionsMapper;
import org.example.mapper.HistoryMapper;
import org.example.mapper.PubMapper;
import org.example.service.HistoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class HistoryServiceImpl extends ServiceImpl<HistoryMapper, History>  implements HistoryService {
    @Autowired
    private HistoryMapper historyMapper;

    @Autowired
    private AttractionsMapper attractionsMapper;


    @Override
    public Object showList(Integer type, Integer id) {
        Object obj=null;
        switch (type){
            case 1:
                obj=historyMapper.selectPubById(id);
                break;
            case 2:
                obj=attractionsMapper.selectAttractionsById(id);
        }
        return obj;
    }

}
